﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace LRT.Syndication.Components
{
    /// <summary>
    /// RSS文章
    /// </summary>
    public class Item
    {
        public Item()
        {
            Title = String.Empty;
            Link = String.Empty;
            Description = String.Empty;
            Author = String.Empty;
            Category = String.Empty;
            Comments = String.Empty;
            Enclosure = String.Empty;
            Guid = String.Empty;
            PubDate = String.Empty;
            Source = String.Empty;
        }
        #region required item


        /// <summary>
        /// 编号
        /// </summary>
        [Display(Name = "编号")]
        [DataMember]
        public int ID
        {
            get;
            set;
        }

        /// <summary>
        /// 标题
        /// </summary>
        [Display(Name = "标题")]
        [DataMember]
        [Required]
        public string Title
        {
            get;
            set;
        }

        /// <summary>
        /// 链接
        /// </summary>
        [Display(Name = "链接")]
        [DataMember]
        [Required]
        public string Link
        {
            get;
            set;
        }

        /// <summary>
        /// 描述
        /// </summary>
        [Display(Name = "描述")]
        [DataMember]
        [Required]
        public string Description
        {
            get;
            set;
        }

        #endregion

        /// <summary>
        /// 作者电子邮件地址
        /// </summary>
        [Display(Name = "作者电子邮件地址")]
        [DataMember]
        public string Author
        {
            get;
            set;
        }

        /// <summary>
        /// 所属的类别(多个)
        /// </summary>
        [Display(Name = "所属的类别")]
        [DataMember]
        public string Category
        {
            get;
            set;
        }

        /// <summary>
        /// 元素允许一个 item 链接到关于该 item 的注释
        /// </summary>
        [Display(Name = "注释链接")]
        [DataMember]
        public string Comments
        {
            get;
            set;
        }

        /// <summary>
        /// 元素允许把媒体文件包含在项目中
        /// </summary>
        [Display(Name = "媒体")]
        [DataMember]
        public string Enclosure
        {
            get;
            set;
        }

        /// <summary>
        /// Guid
        /// </summary>
        [Display(Name = "Guid")]
        [DataMember]
        public string Guid
        {
            get;
            set;
        }

        /// <summary>
        /// 最后发布日期
        /// </summary>
        [Display(Name = "最后发布日期")]
        [DataMember]
        public string PubDate
        {
            get;
            set;
        }

        /// <summary>
        /// 第三方来源
        /// </summary>
        [Display(Name = "第三方来源")]
        [DataMember]
        public string Source
        {
            get;
            set;
        }

    }
}